All Questions
12 questions
12votes
1answer
6kviews
Google FooBar "Prepare The Bunnies Escape"
I'm currently working through the google FooBar challenge, and I'm on the third level, in which I have to find the distance between the top left and bottom right points on a grid. The grid is filled ...
2votes
2answers
7kviews
Finding an increasing sequence from a given array in a time-efficient manner in Python
Problem Statement: Given a sequence of integers as an array, we have to determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the ...
5votes
1answer
329views
AIO programming challenge - Friendlist - Who has the most friends?
I attempted this sample question from the Australia Infomatics Competition. TL;DR - Each line of input contains two numbers, representing a mutual friendship relationship. The output needs to be the ...
7votes
2answers
7kviews
Google FooBar XOR Checksum Challenge
Google FooBar came up a few days ago and I took it as a challenge to learn python quickly while having fun. However, I ran into one challenge today that has left me stumped, I've come up with a ...
4votes
2answers
617views
Number of possible palindrome sequences
Here is the problem description from hackerearth.com: Rohan loves Palindromes. Palindrome is a string that read same forward and backward. For example abba is a ...
2votes
1answer
98views
Optimize Performance challenge 'Vinay Queried '
Input: The first line contains N denoting the length of Target String. This line is followed by the Target String. The Target String is followed by an integer Q denoting the number of queries ...
3votes
1answer
666views
Rhezo and divisibility by 7 challenge
There is a big number with N digits and Q questions. In each question, find if the number formed by the string between indices Li and Ri is divisible by 7 or not. Input: First line ...
8votes
2answers
3kviews
Finding an element in an array that occurs a given number of times
I am trying to solve the below problem from an online coding site: Fredo is pretty good at dealing large numbers. So, once his friend Zeus gave him an array of N numbers, followed by Q queries ...
2votes
2answers
3kviews
Counting pairs of integers which have a predefined difference
I'm doing this HackerRank problem: Given \$N\$ integers, count the number of pairs of integers whose difference is \$K\$. So far, I've ended up with this code: ...
6votes
3answers
2kviews
Project Euler 92: Square digit chains
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, 44 → 32 → 13 → 10 → 1 → 1 85 → ...
2votes
3answers
321views
Performing add/delete/count operations on a list
Problem Statement (HackerRank) You have a list of integers, initially the list is empty. You have to process Q operations of three kinds: add s: Add integer s to your list, note that ...
2votes
1answer
1kviews
SPOJ "SBANK - Sorting Bank Accounts" TLE
I am new tro programming and have chosen python 2.7 to begin with. But, I often have to deal with a TLE while competitive coding like in the problem below, where my code runs fine on all test cases ...